package com.muyu.user.domain.model;

import com.muyu.user.domain.req.SysUserGroupSaveReq;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 用户分组保存请求对象
 *
 * @author liuguoqiang
 * @date 2025-09-14
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "用户分组保存请求对象")
public class SysUserGroupSaveModel{

    /**
     * 分组ID
     */
    @Schema(name = "groupId", title = "分组ID", description = "分组ID" )
    private Long groupId;
    /**
     * 分组名称
     */
    @Schema(name = "groupName", title = "分组名称", description = "分组名称" , required = true)
    private String groupName;

    /**
     * 分组编码
     */
    @Schema(name = "groupCode", title = "分组编码", description = "分组编码" , required = true)
    private String groupCode;

    /**
     * 分组描述
     */
    @Schema(name = "description", title = "分组描述", description = "分组描述" )
    private String description;

    /**
     * 排序
     */
    @Schema(name = "sortOrder", title = "排序", description = "排序" )
    private Long sortOrder;

    /**
     * 状态（0正常 1停用）
     */
    @Schema(name = "status", title = "状态（0正常 1停用）", description = "状态（0正常 1停用）" )
    private String status;


    /**
     * 修改构造器
     */
    public static SysUserGroupSaveModel saveReqBuild(SysUserGroupSaveReq saveReq){
        return SysUserGroupSaveModel.builder()
            .groupId(saveReq.getGroupId())
            .groupName(saveReq.getGroupName())
            .groupCode(saveReq.getGroupCode())
            .description(saveReq.getDescription())
            .sortOrder(saveReq.getSortOrder())
            .status(saveReq.getStatus())
            .build();
    }

}
